#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h> 

int main() {
	int n;
	scanf("%d", &n);

	int* buf = (int*) malloc(sizeof(int) * 2 * n);

	for (int i = 0; i < 2 * n; i++) {
		scanf("%d", &i[buf]);
	}
	int s = 0;
	for (int i = 0; i < n; i++) {
		s += buf[i] * buf[n+i];
	}
	printf("%d", s);
}
